<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://localhost" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://localhost" elementFormDefault="qualified">
  <xs:element name="report">
    <xs:annotation>
      <xs:documentation xml:lang="ro">Raportare pentru programele naţionale de sănătate</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="persons" minOccurs="0">
          <xs:annotation>
            <xs:documentation xml:lang="ro">Lista de persoane înscrise în program</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="person" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                  <xs:documentation xml:lang="ro">Datele de identificare ale pacientului</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="TherapeuticalSchemas" minOccurs="0">
                      <xs:annotation>
                        <xs:documentation xml:lang="ro">Lista de scheme terapeutice</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="TherapeuticalSchema" minOccurs="0" maxOccurs="unbounded">
                            <xs:annotation>
                              <xs:documentation xml:lang="ro">Datele schemei terapeutice</xs:documentation>
                            </xs:annotation>
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="SchemaDrug" minOccurs="0" maxOccurs="unbounded">
                                  <xs:annotation>
                                    <xs:documentation xml:lang="ro">Medicament de pe o schemă terapeutică</xs:documentation>
                                  </xs:annotation>
                                  <xs:complexType>
                                    <xs:attribute name="code" type="xs:string" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Codul Codul medicamentului (valoare din nomenclatorul de medicamente)</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="type" type="xs:string" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Tipul de schemă terapeutică</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="quantity" type="xs:double" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Cantitatea</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
																		<xs:attribute name="date" type="xs:date" use="required">
																			<xs:annotation>
																				<xs:documentation xml:lang="ro">Ziua in care trebuie eliberat medicamentul</xs:documentation>
																			</xs:annotation>
																		</xs:attribute>
                                    <xs:attribute name="AppID" type="xs:long" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                              <xs:attribute name="code" type="xs:string" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Codul schemei terapeutice</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                              <xs:attribute name="categoryCode" type="xs:string" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Codul categoriei</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                              <xs:attribute name="diagCode" type="xs:string" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Codul diagnosticului</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                              <xs:attribute name="validFrom" type="xs:date" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Data de inceput a valabilităţii</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                              <xs:attribute name="validTo" type="xs:date" use="optional">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Data de sfârşit a valabilităţii</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                              <xs:attribute name="AppID" type="xs:long" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="GoodsConsumptions" minOccurs="0">
                      <xs:annotation>
                        <xs:documentation xml:lang="ro">Lista de consumuri de materiale sanitare</xs:documentation>
                      </xs:annotation>
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="GoodsConsumption" minOccurs="0" maxOccurs="unbounded">
                            <xs:annotation>
                              <xs:documentation xml:lang="ro">Consum de materiale sanitare</xs:documentation>
                            </xs:annotation>
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="Good" minOccurs="0" maxOccurs="unbounded">
                                  <xs:annotation>
                                    <xs:documentation xml:lang="ro">Material sanitar</xs:documentation>
                                  </xs:annotation>
                                  <xs:complexType>
                                    <xs:attribute name="code" type="xs:string" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Codul materialului sanitar (valoare din nomenclatorul de materiale sanitare)</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="quantity" type="xs:double" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Cantitatea</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="unitPrice" type="xs:double" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Preţul unitar</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="VATPercent" type="xs:double" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Procentul TVA</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="AppID" type="xs:long" use="required">
                                      <xs:annotation>
                                        <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
                                      </xs:annotation>
                                    </xs:attribute>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                              <xs:attribute name="code" type="xs:string" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Codul consumului</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                              <xs:attribute name="categoryCode" type="xs:string" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Codul categoriei</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                              <xs:attribute name="consumptionDate" type="xs:date" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Data consumului</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                              <xs:attribute name="AppID" type="xs:long" use="required">
                                <xs:annotation>
                                  <xs:documentation xml:lang="ro">Identificatorul unic al înregistrării</xs:documentation>
                                </xs:annotation>
                              </xs:attribute>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="name" type="xs:string" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Numele pacientului</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="cnp" type="xs:string" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">CNP-ul pacientului</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="categoryCode" type="xs:string" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Caregoria PNS ( terapia ) pacientului</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="startDate" type="xs:date" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Data intrarii pacientului in PNS</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="endDate" type="xs:date" use="optional">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Data iesirii pacientului din PNS</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="indicators" minOccurs="0">
          <xs:annotation>
            <xs:documentation xml:lang="ro">Lista de indicatori</xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:sequence>
              <xs:element name="indicator" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                  <xs:documentation xml:lang="ro">Indicator</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:attribute name="code" type="xs:string" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Codul indicatorului (valoare din nomenclatorul de indicatori)</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="value" type="xs:decimal" use="required">
                    <xs:annotation>
                      <xs:documentation xml:lang="ro">Valoarea indicatorului</xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="NHP" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Numărul programului naţional de sănătate (valoarea codului din nomenclatorul de programe naţionale)</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="medicalServiceProviderCUI" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Codul de identificare a furnizorului de servicii</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="medicalServiceProviderName" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Denumirea furnizorului de servicii</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="reportDate" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Data raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="reportStartDate" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Data de început a perioadei de raportare</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="reportEndDate" type="xs:date" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Data de sfârşit a perioadei de raportare</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="reportType" type="xs:unsignedInt" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Tipul raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="contractNo" type="xs:string" use="optional">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Numărul contractului de furnizare de servicii</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="contractYear" type="xs:unsignedInt" use="optional">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Anul de valabilitate a contractului</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="reportNo" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation xml:lang="ro">Numărul de identificare al raportării</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>